<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <t-popup
      class="placement bottom center"
      attach="#attach"
      content="查看本单元全景展厅"
      placement="bottom"
      showArrow
      destroyOnClose
    >
      <img
        v-if="props.info.digitalShowroom"
        class="icon-3d blinking-animation-style"
        id="outlineIcon"
        @click="open(props.info.digitalShowroom)"
        :src="publicUrls + 'free/style1/3dIconRound.png'"
      />
    </t-popup>
    <img
      class="outline-parent-bg"
      :src="publicUrls + 'free/style1/Level1outlineStyle4Bg.webp'"
      alt=""
    />
    <div class="outline jy-style-height">
      <div class="outline-content" :class="!props.info.remarks && !props.info.value && 'outline-content2'">
        <div class="content-tiitle">
          <span>{{ props.info.text }} </span>
          <div class="title-bg">
            <img :src="publicUrls + 'free/style1/Level1outlineStyle1Titlebg1.webp'" alt="" />
            <div class="line"></div>
            <img :src="publicUrls + 'free/style1/Level1outlineStyle1Titlebg1.png.webp'" alt="" />
          </div>
        </div>
        <p class="outline-subTitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
        <div class="cover" v-if="props.info.value">
          <img
            class="outline-cover"
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/format/webp'"
            alt=""
          />
        </div>
        <TextMax
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="props.info.value ? 3 : 11"
        ></TextMax>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'style4',
});
</script>

<script setup lang="ts">
import ExpandableText from './../../../textMode/ExpandableText.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { defineComponent, nextTick, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();
const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});
// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-top: 0;
  margin-right: 280px;
}
.outline-parent-bg {
  width: 688px;
  height: calc(100%);
}
.icon-3d {
  width: 52px;
  height: 64px;
  object-fit: contain;
  position: absolute;
  top: 156px;
  right: 112px;
  z-index: 21;
}
.outline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.outline-content2 {
  justify-content: start !important;
  padding: 272px 0 !important;
}
.outline-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 420px;
  height: 100%;
  padding: 194px 0;
}
.content-tiitle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 22px;
  padding: 0 58px;
  position: relative;
  span {
    font-family: SourceHanSerifCN-Bold;
    font-size: 30px;
    line-height: 34px;
    text-align: center;
    color: #553b2a;
  }
  .title-bg {
    width: 100%;
    height: 23px;
    opacity: 0.4;
    position: absolute;
    left: 0;
    bottom: -11px;
    z-index: -1;
    display: flex;
    justify-content: space-between;
    align-items: end;
    img {
      width: 95px;
      height: 100%;
    }
    img:first-child {
      transform: scaleX(-1);
    }
    .line {
      flex: 1;
      height: 1px;
      background: rgba(127, 108, 94, 1);
    }
  }
}
::v-deep .van-text-ellipsis {
  color: rgba(85, 59, 42, 0.8) !important;
}
.outline-subTitle {
  width: 100%;
  text-align: center;
  font-family: PingFang SC;
  font-size: 20px;
  line-height: 28px;
  text-align: center;
  color: #553b2a;
  opacity: 0.8;
  margin-bottom: 11px;
}
.cover {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  max-height: 251px;
  margin-bottom: 11px;
  border: 1px solid #d4cab7;
  background: rgba(239, 222, 193, 0.5);
  overflow: hidden;
  &:hover img {
    transform: scale(1.2);
  }
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
  }
}
.outline-remarks {
  width: 510px;
  :deep(.openText) {
    justify-content: center;
    font-family: PingFang SC;
    font-size: 16px;
    font-weight: 400;
    line-height: 32px;
    color: rgba(85, 59, 42, 1);
    span {
      color: rgba(85, 59, 42, 1);
    }
  }
  :deep(.text p) {
    color: rgba(50, 43, 37, 1);
  }
  :deep(.omission) {
    color: rgba(50, 43, 37, 1);
  }
}
::v-deep .t-popup__content {
  background: #886c56;
  padding: 2px 12px;
  font-family: 'Microsoft YaHei';
  font-size: 13px;
  line-height: 20px;
  color: #fef3df;
  box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);
  margin-top: 6px !important;
}
::v-deep .t-popup__arrow::before {
  background: #886c56;
  border: none;
  box-shadow: none !important;
}
</style>